package com.middlegroup.payadmin.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.middlegroup.payadmin.mapper.RefundBillsMapper;
import com.middlegroup.payadmin.pojo.dto.DataGrid;
import com.middlegroup.payadmin.pojo.po.RefundBills;
import com.middlegroup.payadmin.service.RefundBillsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 退款表 服务实现类
 * </p>
 *
 * @author pc123
 * @since 2019-01-04
 */
@Service
public class RefundBillsServiceImpl extends ServiceImpl<RefundBillsMapper, RefundBills> implements RefundBillsService {

    @Resource
    private RefundBillsMapper refundBillsMapper;

    @Override
    public PageInfo<RefundBills> getRefundBillsList(DataGrid grid, RefundBills refundBills) {
        grid.getOrderBy();
        return PageHelper.startPage(grid.getPageNum(), grid.getPageSize())
                .doSelectPageInfo(() -> this.refundBillsMapper.getRefundBillsList(refundBills));
    }
}
